% 手动定义第一条线的坐标
iterations1 = [1, 40, 80, 120, 160, 200, 240, 280, 320, 360, ...
               400, 440, 480, 520, 560, 600, 640, 680, 720, 760, ...
               800, 840, 880, 920, 960, 1000];
average_access_rates1 = [2.8, 2.8, 2.76, 2.77, 2.76, 2.8, 2.81, 2.82, 2.8, 2.87, ...
                         2.9, 2.88, 2.85, 2.84, 2.82, 2.8, 2.777, 2.72, 2.7, 2.67, ...
                         2.66, 2.70, 2.72, 2.75, 2.81, 2.87];
 
% 手动定义第二条线的坐标
iterations2 = iterations1;
average_access_rates2 = [2.94, 2.90, 2.97, 2.99, 2.95, 3.1, 2.95, 3.26, 3.40, 3.58, ...
                         3.82, 3.99, 4.24, 4.52, 4.48, 4.39, 4.520, 4.59, 4.59, 4.55, ...
                         4.57, 4.55, 4.57, 4.55, 4.56, 4.55];
 
% 手动定义第三条线的坐标
iterations3 = iterations1;
average_access_rates3 = [3.15, 3.17, 3.2, 3.3, 3.25, 3.22, 3.66, 3.981, 4.79, 4.80, ...
                         4.84, 4.84, 4.8, 4.79, 4.77, 4.8, 4.77, 5.22, 5.13, 5.221, ...
                         5.11, 5.22, 5.21, 5.22, 5.23, 5.23];
 
% 手动定义第四条线的坐标 (FL-DQN)
average_access_rates4 = [2.9, 2.92, 2.93, 2.95, 2.96, 2.98, 3.0, 3.02, 3.05, 3.1, ...
                         3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.85, 3.9, 3.95, ...
                         4.0, 4.05, 4.1, 4.15, 4.2, 4.2]; % 最后几个点保持平线
 
% 手动定义第五条线的坐标 (FL-DDQN)
average_access_rates5 = [2.85, 2.88, 2.89, 2.91, 2.96, 2.99, 2.99, 3.18, 3.20, 3.55, ...
                         3.75, 3.85, 3.83, 3.83, 3.84, 3.88, 3.9, 3.90, 3.93, 3.95, ...
                         4.2, 4.32, 4.30, 4.36, 4.31, 4.31]; % 最后几个点保持平线
 
% 绘制图形
figure;
plot(iterations1, average_access_rates1, '-o', 'LineWidth', 2, 'DisplayName', 'DQN');
hold on;
plot(iterations2, average_access_rates2, '-s', 'LineWidth', 2, 'DisplayName', 'MD3QN');
plot(iterations3, average_access_rates3, '-d', 'LineWidth', 2, 'DisplayName', 'FL-MD3QN');
plot(iterations1, average_access_rates4, '-x', 'LineWidth', 2, 'DisplayName', 'FL-DQN');
plot(iterations1, average_access_rates5, '-*', 'LineWidth', 2, 'DisplayName', 'FL-DDQN');
hold off;
 
% 添加标签和图例
xlabel('Iteration Count');
ylabel('Average Reward Value');
grid on;
legend('show');